﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _24_01_17_First_task
{
    class Human
    {
        private string firstName;
        private string lastName;
        private DateTime dateOfBirth;

        public string FirstName
        {
            get
            {
                return firstName;
            }
            set
            {
                if(value==null)
                {
                    Console.WriteLine("Enter valid first name");
                }
                firstName=value;
            }

        }
        public string LastName
        {
            get
            {
                return lastName;
            }
            set
            {
                if (value == null)
                {
                    Console.WriteLine("Enter valid last name");
                    
                }
                lastName = value;
            }

        }
        public DateTime DateOfBirth
        {
            get
            {
                return dateOfBirth;
            }
            set
            {
                if (value > DateTime.Now)
                {
                    Console.WriteLine("enter valid date of birth");
                  
                }
                else
                {
                    dateOfBirth = value;
                }
            }

        }
        public Human(string firstName,string lastName , DateTime dateOfBirth)
            {
            this.FirstName = firstName;
            this.LastName = lastName;
            this.DateOfBirth = dateOfBirth;
            }

    }
}
